#pragma once
#include <d3d9.h>
#include "Utility\FixedArray.h"

class DxIndexBuffer
{
public:
	DxIndexBuffer(void);
	~DxIndexBuffer(void);

	bool CreateIndexBuffer(int iLength);
	void SetIndices(FixedArray<u16> * indices);
	
	bool Lock();
	bool UnLock();

	IDirect3DIndexBuffer9*	GetBuffer()			{ return m_pIndexBuffer; }
	int						GetPrimativeCount()	{ return m_iPrimCount; }

protected:
	IDirect3DIndexBuffer9*	m_pIndexBuffer;
	u16*					m_pLockPointer;
	bool					m_bLocked;
	int						m_iPrimCount;
};

